<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__STATIC__/css/layui.css">
    <link rel="stylesheet" href="__STATIC__/css/view.css"/>
    <link rel="icon" href="/favicon.ico">
    <title>管理后台</title>
</head>
<body class="layui-view-body">
    <div class="layui-content">
        <div class="layui-row">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="form-box">
                            <div class="layui-form-item">
                              <label class="layui-form-label">修改名称</label>
                              <div class="layui-input-block">
                                <input type="text" id="username" name="username" lay-verify="title" autocomplete="off" placeholder="账号" class="layui-input">
                              </div>
                            </div>
                            <div class="layui-form-item">
                              <div class="layui-input-block">
                                <button class="layui-btn" onclick="article_save()" lay-filter="demo1">立即提交</button>
                              </div>
                            </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    {include file="common/footer"}
    <script src="__STATIC__/layui.all.js"></script>
    <script>
      var element = layui.element;
      var table = layui.table;
      var form = layui.form;
      function article_save() {
          var username = $("#username").val();
              $.ajax({
              url: '{:Url("User/edit")}',
              type: 'POST',
              data: { "username":username,"id":{$id}},
              dataType: 'text',
              success: function (res) {
                        layer.msg('修改成功');
                         // console.log('添加成功')
                         var index = parent.layer.getFrameIndex(window.name);
                         parent.layer.close(index); 
                         window.parent.location.reload();
                   }
            })
          }
    </script>
</body>
</html>